<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <button onclick="test()">点我试试</button>
    <h2 id="hello">我想打篮球！</h2>

    <button onclick="chou()">你愁啥</button>
    <h2 id="hello2">瞅你咋滴！</h2>
    <script>
       /* 1. 改变一个 <h2> 元素的 HTML 内容 : */
       function test(){
           document.getElementById("hello").innerHTML = "我们可以一起去！";
       }

       /* 2. 改变一个<h2>的 HTML 样式 */
       function chou(){
           document.getElementById("hello2").style.color = "red";
           document.getElementById("hello2").style.fontFamily = "华文彩云";
       }
    </script>
</body>
</html>